package com.lagou.pojo;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

/**
 * 基础响应
 * @author
 */
@JsonSerialize
public class BaseResponse {

    /**
     * 操作代码
     */
    int resultCode;

    /**
     * 提示信息
     */
    String resultMsg;

    public BaseResponse(){
    }

    public BaseResponse(ResultCode ResultCode){
        this.resultCode = ResultCode.code();
        this.resultMsg = ResultCode.message();
    }

    public BaseResponse(String resultMsg){
        this.resultMsg = resultMsg;
    }

    public static BaseResponse SUCCESS(){
        return new BaseResponse(ResultCode.SUCCESS);
    }

    public static BaseResponse FAIL(){
        return new BaseResponse(ResultCode.FAIL);
    }
    public static BaseResponse FAIL(String resultMsg){
        return new BaseResponse(resultMsg);
    }

    public int getResultCode() {
        return resultCode;
    }

    public void setResultCode(int resultCode) {
        this.resultCode = resultCode;
    }

    public String getResultMsg() {
        return resultMsg;
    }

    public void setResultMsg(String resultMsg) {
        this.resultMsg = resultMsg;
    }
}
